home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: Alternatives to cin?
- Date: 16 Feb 1996 11:41:33 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4g1qhd$mhf@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe4.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Feb 13, 1996 21:50:23 in article <Alternatives to cin?>,
- 'michael_@sfsu.edu (Michael J. Legac)' wrote:
-
-
- >
- > I've been programming in C/C++ for about a year and a half now;
- >primarily for my school classes, but I've yet to find an alternative to
- >the kludgy cin/scanf. I mainly code with gcc/g++, on my school's Solaris
- 5.3
- >system and at home on Linux.
- > Basically, I just want to get rid of the <CR> cin requires. I
- >guess what I'm looking for is either some way to do key bindings. I've
- >done this before in Pascal and ASM on the PC, using interupts, but I'm
- >sure there is a more portable way. Any code I write, I'd like to compile
- >and run on either UNIX/Linux/x86.
- > Comments/suggestions are appreciated.
- >
- There's no portable way to do that in the language. Reading the
- keyboard directly is platform-dependent. The easiest thing to do,
- if you want portability, is to create a small library yourself in a
- version for each platform. On Unix, you can use the curses
- library. On PC's, use the conio stuff or assembler.
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-